<?php
	header('Content-Type: text/html; charset=UTF-8');
	include("connect.php");
	$result = pg_query($dbConn, "SELECT id, nombre, contenido FROM pagina WHERE id=".$_REQUEST["id"]);
	if ($row = pg_fetch_object($result)) {
		$tituloMision = $row->nombre;
		$textoMision = $row->contenido;
		$id = $row->id;
	}
?>

<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery.validate.js"></script>
<script type="text/javascript" src="scripts/ckeditor.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$("#nombre").focus();
		$("#form").validate();
	});
</script>



<?php
	include_once("cabecera.php");
?>
	<div id="contenido">
		<div id="colIzquierda">
			<form id="form" method="post" action="guardarCambiosSeccion.php">
				<input id="nombre" class="required" name="nombre" value="<?php echo $tituloMision;?>"></input>
				<textarea id="contenido" class="required ckeditor" name="contenido" type="text" rows="10" cols="30"><?php echo $textoMision;?></textarea>
				<input id="id" name="id" type="hidden" value="<?php echo $id;?>"></input>
				<input type="submit"></input>
			</form>
		</div>
	</div>
<?php
	include_once("pie.php");
?>
